<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link rel="stylesheet" type="text/css" href="../css/style.css"/>
<link rel="stylesheet" type="text/css" href="../css/sty.css"/>
<title>tin hien thi</title>
</head>

<body>
<div id="wrapper">
<div id="header">
     <div id="top-header" class="clearfix">
        <a href="#" id="logo" class="clearfix"><img src="../images/4468766.jpg" width="100" height="60" />
       <h3>Tin Từng Giây</h3></a>
 </div>
  <br />
</div>
<hr />
<br />
<center><p style="color: #3C9; font-size:24px">TRANG QUẢN TRỊ VIÊN - TIN TỪNG GIÂY<br />
<br />
<div style="width:815.5px" id="menu">
     <ul class="clearfix">
	 <li class="active"><a href="dn.php?trang=thanhvien">Quản lý thành viên</a></li>
     <li class="active"><a href="dn.php?trang=editor">Quản lý biên tập viên</a></li>
     <li class="active"><a href="dn.php?trang=tinhienthi">Quản lý tin hiện thị</a></li>
     <li class="active"><a href="dn.php?trang=tinan">Quản lý tin ẩn</a></li>
     <li class="active"><a href="dn.php?trang=quangcao">Quản lý quảng cáo</a></li>
     <li class="active"><a href="dn.php?trang=binhluan">Quản lý bình luận</a></li></ul></div></center><br />
<br />
<table style="margin-left: 20px" width="850">
<tr>
   <td style="border-bottom:#000 solid 1px" width="34" height="34">STT</td>
    <td style="border-bottom:#000 solid 1px" width="118">Tài khoản</td>
    <td style="border-bottom:#000 solid 1px" width="154">Họ Tên</td>
    <td style="border-bottom:#000 solid 1px" width="233">Email</td>
    <td style="border-bottom:#000 solid 1px" width="105">Giới tính</td>
    <td style="border-bottom:#000 solid 1px" width="125">Thao tác</td>
  </tr>
  <?php
	include('mysql.php');
	if(isset($_POST['nangcapdn'])){
		$tendn=$_POST['nangcapdn'];
		$r="update user set NhomUser=1 where TenDN='$tendn'";
		$q=mysqli_query($dbc,$r) or die(mysqli_error($dbc));
		if(mysqli_affected_rows($dbc)){
				echo "<script>alert('Thành viên dã du?c nâng c?p thành User Editor');</script>";
		}
	}
?>
<?php 
	$r="SELECT Hoten,TenDN,Ngaysinh,Gioitinh FROM user where NhomUser=0 ";
	$q=mysqli_query($dbc,$r);
	$dem=1;
	while ($row=mysqli_fetch_array($q)){
?>
<script>
	function nangcap(id,layten){
		var tendn=document.getElementById(layten).value;
		document.getElementById(id).value=tendn;
	}
</script>
  <tr>
    <td height="37"><?php echo $dem; ?></td>
    <td><?php echo $row['Hoten']; ?></td>
    
    <td><input id="tendn<?php echo $dem; ?>" readonly="readonly" value="<?php echo $row['TenDN']; ?>"/></td>
    <td><?php echo $row['Ngaysinh']; ?></td>
    <td><?php echo $row['Gioitinh']; ?></td>
    <td><form id="form2" name="form2" method="post" action="">
    
	<input type="hidden" name="nangcapdn" id="nangcapdn<?php echo $dem;?>" />
    
      <input type="submit" name="button" id="xoa<?php echo $dem;?>" onmousemove="nangcap(id='nangcapdn<?php echo $dem;?>',layten='tendn<?php echo $dem;?>')" value="Nâng Cấp" alt="Nâng cấp thành viên lên Editor"/>
    </form></td>
  </tr>
<?php $dem++; } ?>
</table>
</body>
</html>



